//      gui.h
//      
//      Copyright 2011 DJ Shaji <djshaji@gmail.com>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.


#ifndef X_GUI
#define X_GUI

#include <gtk/gtk.h>

void x_gui ( void ) ;

typedef struct _XGui
{
	GtkDialog * dialog ;
	GtkNotebook * notebook ;
	GtkEntry * url, * file_types ;
	GtkButton * cancel ;
	GtkProgressBar * bar, * bar2 ;
	GtkStatusbar * statusbar ;
	GtkTreeView * view ;
	GtkTreeModel * store ;
	GtkFileChooserButton * file_chooser ;
	GCancellable * cancellable ;
	GtkSpinButton * recurse ;
} XGui ;

typedef struct _XGuiFile {
	gboolean file_is_loading ;
	GFile * file ;
	gchar * url ;
	XGui * gui ;
	GAsyncResult * result ;
	guchar reserved0, reserved1, reserved2, reserved3, reserved4, 
	reserved5, reserved6, reserved7, reserved8, reserved9 ;
} XGuiFile ;

void x_gui_set_status ( XGui * gui, gchar * message ) ;
void _x_gui_cancel_desensitize ( GtkWidget * cancel ) ;
void x_gui_recurse ( XGui * gui, GList * old_list, GList * new_list ) ;
void x_gui_urls_append_from_text ( GtkTreeStore * store, GtkTreeIter * parent, gchar * text, gchar * pattern, gint recurse, XGui * gui ) ;
void x_gui_download_files ( XGui * gui ) ;
void x_gui_find_duplicates ( GtkTreeStore * store ) ;
gchar * x_gui_get_url_contents ( XGui * gui, gchar * url ) ;
void x_gui_file_ready ( GObject * source, GAsyncResult * result, XGuiFile * gui ) ;
#endif
